package top.chukongxiang.project.base.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import top.chukongxiang.project.base.oauth2.Oauth2HttpMessageConverter;

import java.util.List;

/**
 * @author 楚孔响
 * @version 1.0
 * @date 2022/1/11 13:15
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

    }

    @Override
    public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {

        converters.add(0, new Oauth2HttpMessageConverter());
        converters.add(1, new MyFastJsonHttpMessageConverter());

    }

}
